In some situation we needed to apply border over the image for the particular div element id in jquery.We can set multiple css properties to border over image using jquery on pageload.
Example:
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Animated borderover image using css</title>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
$(function () {
$('#firstdiv').find('img').css("border", "solid 2px #2e9fff");
});
</script>
<style type="text/css">
.rect {
width: 350px;
height: 79px;
cursor: pointer;
padding: 5px;
}
</style>
</head>
<body style="border: 1px solid #DED8D8; width: 500px; height: 300px">
<h2 style="color: #FF5722;">apply border over image for aparticular div element</h2>
<div id="firstdiv" class="box">
<a href="http://www.infinetsoft.com/" title="header logo image">
<img src="http://www.infinetsoft.com/Images/logoinfi.png" class="rect" alt="header logo">
</a>
</div>
<div class="box">
<a href="http://www.infinetsoft.com/" title="footer logo image">
<img src="http://www.infinetsoft.com/Images/footer_logo1.png" class="rect" alt="footer logo">
</a>
</div>
</body>
</html>
Output:
Post your comments / questions
Recent Article
- The request was aborted: Could not create SSL/TLS secure channel -Error in Asp.net
- FieldError: Cannot resolve keyword 'id' into field in Django project
- How to hide the ID field from the Django admin?
- It is impossible to add a non nullable field without specifying a default. Django error
- ImportError: cannot import name 'url' from 'django.conf.urls' - Django Error
- How to Enable Virtualization in BIOS Security Settings in Intel Processors For Android Studio?
- Dependency 'androidx.activity:activity:1.8.0' requires libraries and applications that depend on it.
- AttributeError: 'NoneType' object has no attribute 'get_text' - Python
Related Article